/*
 * Package: org.grassfield.common.dao
 * FileName: ModuleDAOTest.java
 *  
 * Created by pandian on Jan 28, 2011
 */
package dao;

import java.util.List;

import bean.Module;

import test.BaseTest;



/**
 * A junit test case for ModuleDAO.
 */
public class ModuleDAOTest extends BaseTest {
	private IModuleDAO moduleDAO;

	/**
	 * Sets the module dao.
	 * 
	 * @param moduleDAO the new module dao
	 */
	public void setModuleDAO(IModuleDAO moduleDAO) {
		this.moduleDAO = moduleDAO;
	}
	
	/**
	 * Test case for list.
	 */
	public void testList(){
		List<Module> list = this.moduleDAO.list();
		super.assertNotNull("list is null", list);
		super.assertTrue("empty list", list.size()>0);
		for (Module m:list){
			System.out.println(m.getModuleName()+" has "+m.getMenuItemList().size()+" menu items.");
		}
	}
}
